package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Window.Type;
import net.miginfocom.swing.MigLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JSeparator;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class NewProductGui extends JFrame {

	private JPanel contentPane;
	private JTextField modelField;
	private JTextField engineTypeField;
	private JTextField partNameField;
	private JTextField priceField;
	private JTextField numberField;


	/**
	 * Create the frame.
	 */
	public NewProductGui() {
		setAlwaysOnTop(true);
		setTitle("New Product ");
		setType(Type.UTILITY);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 450, 279);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new MigLayout("", "[][grow]", "[][][][][][][][][][]"));
		
		JLabel lblAddProduct = new JLabel("Add Product");
		contentPane.add(lblAddProduct, "cell 0 0 2 1,alignx center");
		
		JSeparator separator = new JSeparator();
		contentPane.add(separator, "cell 0 1 2 1,growx");
		
		JLabel lblBrand = new JLabel("Car Brand:");
		contentPane.add(lblBrand, "cell 0 2,alignx trailing");
		
		JComboBox carBrandField = new JComboBox();
		carBrandField.setModel(new DefaultComboBoxModel(new String[] {"Alfa Romeo", "Audi", "BMW", "Chevrolet", "Chrysler", "Citro\u00EBn", "Dacia", "Daewoo", "Daihatsu", "Dodge", "Fiat", "Ford", "Honda", "Hyundai", "Iveco", "Jaguar", "Jeep", "Kia", "Lancia", "Land Rover", "Lexus", "Mazda", "Mercedes", "Mini", "Mitsubishi", "Nissan", "Opel", "Peugeot", "Porsche", "Renault", "Rover", "Saab", "Seat", "Skoda", "Smart", "Subaru", "Suzuki", "Toyota", "Volkswagen", "Volvo"}));
		contentPane.add(carBrandField, "cell 1 2,growx");
		
		JLabel lblModel = new JLabel("Model:");
		contentPane.add(lblModel, "cell 0 3,alignx trailing");
		
		modelField = new JTextField();
		contentPane.add(modelField, "cell 1 3,growx");
		modelField.setColumns(10);
		
		JLabel lblEngineType = new JLabel("Engine type:");
		contentPane.add(lblEngineType, "cell 0 4,alignx trailing");
		
		engineTypeField = new JTextField();
		contentPane.add(engineTypeField, "cell 1 4,growx");
		engineTypeField.setColumns(10);
		
		JLabel lblPartName = new JLabel("Part name:");
		contentPane.add(lblPartName, "cell 0 5,alignx trailing");
		
		partNameField = new JTextField();
		contentPane.add(partNameField, "cell 1 5,growx");
		partNameField.setColumns(10);
		
		JLabel lblPrice = new JLabel("Price:");
		contentPane.add(lblPrice, "cell 0 6,alignx trailing");
		
		priceField = new JTextField();
		contentPane.add(priceField, "cell 1 6,growx");
		priceField.setColumns(10);
		
		JLabel lblNumber = new JLabel("Number:");
		contentPane.add(lblNumber, "cell 0 7,alignx trailing");
		
		numberField = new JTextField();
		contentPane.add(numberField, "cell 1 7,growx");
		numberField.setColumns(10);
		
		JSeparator separator_1 = new JSeparator();
		contentPane.add(separator_1, "cell 0 8 2 1,growx");
		
		JButton btnNewButton = new JButton("Add");
		contentPane.add(btnNewButton, "cell 0 9");
		
		JButton btnNewButton_1 = new JButton("Cancel");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		contentPane.add(btnNewButton_1, "cell 1 9");
	}

}
